<template>
  <ui-page showTabbar>
    <view class="content">
      <image class="logo" src="/static/logo.png"></image>
      <u-button @click="go()">登陆</u-button>
    </view>
  </ui-page>
</template>

<script setup>
import { useUserStore } from '@/store/modules/user'
import { usePageCycle } from '@/composables/global.js'

usePageCycle((e) => {})
let store = useUserStore()
const go = () => {
  uni.showToast({
    title: '登录成功，返回原页面'
  })
  store.setToken('44444')
  store.setUserInfo({ image: '', name: 'xiaoming1' })
  setTimeout(() => {
    uni.$navBackAfterLogin()
  }, 500)
}

// #ifdef APP-PLUS
onShow(() => {
  uni.hideTabBar({
    success: () => {
      console.log('隐藏成功onLaunch')
    },
    fail: () => {
      console.log('隐藏失败onLaunch')
    }
  })
})

// #endif
</script>

<style lang="scss" scoped></style>
